/*     */ package eos.moe.dragoncore;
/*     */ 
/*     */ import java.io.File;
/*     */ import net.minecraft.command.ICommand;
/*     */ import net.minecraft.command.ServerCommandManager;
/*     */ import net.minecraft.nbt.NBTTagCompound;
/*     */ import net.minecraft.server.MinecraftServer;
/*     */ import net.minecraftforge.common.config.Configuration;
/*     */ import net.minecraftforge.fml.common.Mod;
/*     */ import net.minecraftforge.fml.common.Mod.EventHandler;
/*     */ import net.minecraftforge.fml.common.Mod.Instance;
/*     */ import net.minecraftforge.fml.common.ModMetadata;
/*     */ import net.minecraftforge.fml.common.SidedProxy;
/*     */ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
/*     */ import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
/*     */ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
/*     */ import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
/*     */ import org.apache.logging.log4j.Level;
/*     */ import org.apache.logging.log4j.Logger;
/*     */ import org.apache.logging.log4j.core.Appender;
/*     */ import org.apache.logging.log4j.core.Layout;
/*     */ import org.apache.logging.log4j.core.Logger;
/*     */ import org.apache.logging.log4j.core.appender.FileAppender;
/*     */ import org.apache.logging.log4j.core.layout.PatternLayout;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ @Mod(modid = "nbtedit", name = "In-game NBTEdit", version = "1.11.2-2.0.2", acceptableRemoteVersions = "*", acceptedMinecraftVersions = "[1.12.2]")
/*     */ public class qz
/*     */ {
/*     */   public static final String c = "nbtedit";
/*     */   public static final String r = "In-game NBTEdit";
/*     */   public static final String f = "1.11.2-2.0.2";
/*  35 */   public static final nw s = new nw();
/*  36 */   public static final fr m = new fr();
/*     */   
/*     */   public static Logger l;
/*     */   
/*  40 */   public static oy t = null;
/*     */   
/*     */   public static boolean d = true;
/*     */   
/*     */   public static boolean z = false;
/*     */   
/*     */   @Instance("nbtedit")
/*     */   private static qz i;
/*     */   @SidedProxy(clientSide = "eos.moe.dragoncore.up", serverSide = "eos.moe.dragoncore.xu")
/*     */   public static xu w;
/*     */   private jp q;
/*     */   
/*     */   @EventHandler
/*     */   public void v(FMLPreInitializationEvent fMLPreInitializationEvent) {
/*  54 */     Configuration configuration = new Configuration(fMLPreInitializationEvent.getSuggestedConfigurationFile());
/*  55 */     configuration.load();
/*  56 */     d = configuration.get("General", "opOnly", true, "true if only Ops can NBTEdit; false allows users in creative mode to NBTEdit").getBoolean(true);
/*  57 */     z = configuration.get("General", "editOtherPlayers", false, "true if editing players other then your self is allowed. false by default. USE AT YOUR OWN RISK").getBoolean(false);
/*  58 */     if (configuration.hasChanged()) {
/*  59 */       configuration.save();
/*     */     }
/*     */     
/*  62 */     l = fMLPreInitializationEvent.getModLog();
/*  63 */     Logger logger = (Logger)l;
/*  64 */     logger.setAdditive(false);
/*  65 */     logger.setLevel(Level.ALL);
/*     */ 
/*     */     
/*  68 */     PatternLayout patternLayout = PatternLayout.newBuilder().withPattern("[%d{MM-dd HH:mm:ss}] [%level]: %msg%n").build();
/*  69 */     FileAppender.Builder builder = FileAppender.newBuilder();
/*  70 */     builder.withFileName("logs/NBTEdit.log").withName("NBTEdit File Appender").withLayout((Layout)patternLayout).withIgnoreExceptions(false);
/*  71 */     FileAppender fileAppender = builder.build();
/*  72 */     fileAppender.start();
/*  73 */     logger.addAppender((Appender)fileAppender);
/*     */     
/*  75 */     ModMetadata modMetadata = fMLPreInitializationEvent.getModMetadata();
/*  76 */     modMetadata.autogenerated = false;
/*  77 */     modMetadata.modId = "nbtedit";
/*  78 */     modMetadata.version = "1.11.2-2.0.2";
/*  79 */     modMetadata.name = "In-game NBTEdit";
/*  80 */     modMetadata.authorList.add("Davidee");
/*     */     
/*  82 */     modMetadata.credits = "Thanks to Mojang, Forge, and all your support.";
/*  83 */     modMetadata.description = "Allows you to edit NBT Tags in-game.\nPlease visit the URL above for help.";
/*  84 */     modMetadata.url = "http://www.minecraftforum.net/topic/1558668-151/";
/*     */   }
/*     */   
/*     */   @EventHandler
/*     */   public void v(FMLInitializationEvent fMLInitializationEvent) {
/*  89 */     l.trace("NBTEdit Initalized");
/*  90 */     this.q = new jp(new File(new File(w.v(), "saves"), "NBTEdit.dat"));
/*  91 */     m.z();
/*     */   }
/*     */   
/*     */   @EventHandler
/*     */   public void v(FMLPostInitializationEvent fMLPostInitializationEvent) {
/*  96 */     w.v();
/*     */   }
/*     */   
/*     */   @EventHandler
/*     */   public void v(FMLServerStartingEvent fMLServerStartingEvent) {
/* 101 */     MinecraftServer minecraftServer = fMLServerStartingEvent.getServer();
/* 102 */     ServerCommandManager serverCommandManager = (ServerCommandManager)minecraftServer.func_71187_D();
/* 103 */     serverCommandManager.func_71560_a((ICommand)new xs());
/* 104 */     l.trace("Server Starting -- Added \"/nbtedit\" command");
/*     */   }
/*     */   
/*     */   public static void v(Level a, String str) {
/* 108 */     l.log(a, str);
/*     */   }
/*     */   
/*     */   public static void v(String a, String str1, Throwable throwable) {
/* 112 */     l.warn("class: " + a + " method: " + str1, throwable);
/*     */   }
/*     */   
/* 115 */   public static final String g = System.getProperty("line.separator");
/*     */   
/*     */   public static void v(NBTTagCompound a) {
/* 118 */     nv nv = new nv(a);
/* 119 */     String str = "";
/* 120 */     for (String str1 : nv.v()) {
/* 121 */       str = str + g + "\t\t\t" + str1;
/*     */     }
/* 123 */     v(Level.TRACE, str);
/*     */   }
/*     */   
/*     */   public static jp v() {
/* 127 */     return i.q;
/*     */   }
/*     */ }


/* Location:              D:\fanbian\[D][龙之核心]DragonCore-2.6.0.3.jar!\eos\moe\dragoncore\qz.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */